package com.lbmb.photodrawaimanager.enums;

import com.lbmb.photodrawaimanager.exception.BusinessException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author javaer
 */

@Getter
@AllArgsConstructor
public enum ErrorCode implements ErrorCodeEnums {

    /**
     * 异常枚举
     */
    GLOBAL_PASS(200, "请求成功"),
    GLOBAL_EXCEPTION(300, "服务器开小差了o(╥﹏╥)o"),
    PARAM_ERROR(81300000, "参数错误"),
    STOCK_UPDATE_FAIL(81300001,"库存操作失败"),
    GOODS_NOT_FOUND(81300002,"goods not exist"),
    SHOP_NOT_FOUND(81300003,"包含未成功同步的门店"),
    PARK_GOODS_ADD_NOT_ALLOW(81300004,"商品库存不能为0"),
    PARK_GOODS_CITY_NOT_ALLOW(81300005,"聚合商品需在同一城市"),
    PARK_GOODS_SAVE_NOT_ALLOW(81300006,"当前有隐藏/售光/下架商品，不得聚合"),
    PARK_GOODS_PRICE_ADD_NOT_ALLOW(81300007,"所选商品必须有一个设置过组合价"),
    PARK_GOODS_TIME_ADD_NOT_ALLOW(81300008,"拼团结束时间不能比商品有效期长"),
    APPLY_GOODS_PUSH_ON_STATUS_ERROR(60000001,"非法修改审核状态,或短期内有其他用户操作状态"),
    CIRCLE_GOODS_ADD_NOT_ALLOW_DEL(81300009,"待审核的商品不能删除"),
    CIRCLE_GOODS_NAME_ALLOW_EXIST(81300010,"名称重复"),
    NULL_PORT(82300010,"入参参数为空"),
    USER_NOT_FOUND(82300011,"用户未找到"),
    ;

    private final Integer code;
    private final String message;

    public BusinessException toBizException() {
        return new BusinessException(this);
    }
}
